#include <stdlib.h>
#include <stdio.h>


char *int2bin(int a, char *buffer, int buf_size);

int main()
{
#define P(X) printf(X)

	P( "ahoj \
svete!\n"
	 );

#define A 41 /*\
	+ 1 */ + 12
	printf( "A=%d\n", A );

	return 0;
}

// (copied from stackoverflow.com:)

// buffer must have length >= sizeof(int) + 1
// Write to the buffer backwards so that the binary representation
// is in the correct order i.e.  the LSB is on the far right
// instead of the far left of the printed string
char *int2bin(int a, char *buffer, int buf_size) {
    buffer += (buf_size - 1);

		int i;
    for (i = 31; i >= 0; i--) {
        *buffer-- = (a & 1) + '0';

        a >>= 1;
    }

    return buffer;
}

